package ph.com.gs3.formalistics.presenter.adapters;

import java.util.ArrayList;
import java.util.List;

import ph.com.gs3.formalistics.model.valueobjects.business.Message;
import ph.com.gs3.formalistics.service.managers.ImageManager;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class ThreadMessageListItemViewAdapter extends BaseAdapter {

	private List<Message> threadMessages;
	private ImageManager imageManager;

	public ThreadMessageListItemViewAdapter(Context context, List<Message> threadMessages) {
		threadMessages = threadMessages == null ? new ArrayList<Message>() : threadMessages;
		imageManager = ImageManager.getDefaultInstance(context.getApplicationContext());
	}

	public void setThreadMessages(List<Message> threadMessages) {
		threadMessages.clear();
		threadMessages.addAll(threadMessages);
		notifyDataSetChanged();
	}

	@Override
	public int getCount() {
		return threadMessages.size();
	}

	@Override
	public Object getItem(int position) {
		return threadMessages.get(position);
	}

	@Override
	public long getItemId(int position) {
		return Long.parseLong(threadMessages.get(position).getId());
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		View row = convertView;

		if (row == null) {

		}

		return row;
	}

}
